package org.abettor.angleworm.jetty;

import java.net.InetAddress;

import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.servlet.Context;

public class Bootup
{
	public static void main(String[] args) throws Exception
	{
		InetAddress host = InetAddress.getLocalHost();
		String bindAddr = host.getHostAddress();

		Connector connector = new SelectChannelConnector();
		connector.setPort(2468);
		connector.setHost(bindAddr);
		connector.open();

		Server server = new Server();
		server.addConnector(connector);

		Context rootCntxt = new Context(server, "/", Context.SESSIONS);
		rootCntxt.addServlet("org.abettor.angleworm.jetty.TestServlet", "/test.servlet");

		server.start();
		Thread.sleep(60000);
		server.stop();
		connector.close();
	}
}
